home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-PPC / FEATURE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  65 lines

  1. /*
  2.  * Definitions for accessing the Feature Control Register (FCR)
  3.  * on Power Macintoshes and similar machines.  The FCR lets us
  4.  * enable/disable, reset, and power up/down various peripherals.
  5.  *
  6.  * This file is subject to the terms and conditions of the GNU General Public
  7.  * License.  See the file "COPYING" in the main directory of this archive
  8.  * for more details.
  9.  *
  10.  * Copyright (C) 1998 Paul Mackerras.
  11.  */
  12. #ifndef __ASM_PPC_FEATURE_H
  13. #define __ASM_PPC_FEATURE_H
  14.  
  15. /*
  16.  * The FCR bits for particular features vary somewhat between
  17.  * different machines.  So we abstract a list of features here
  18.  * and let the feature_* routines map them to the actual bits.
  19.  */
  20. enum system_feature {
  21.     FEATURE_null,
  22.     FEATURE_Serial_reset,
  23.     FEATURE_Serial_enable,
  24.     FEATURE_Serial_IO_A,
  25.     FEATURE_Serial_IO_B,
  26.     FEATURE_SWIM3_enable,
  27.     FEATURE_MESH_enable,
  28.     FEATURE_IDE_enable,
  29.     FEATURE_VIA_enable,
  30.     FEATURE_CD_power,
  31.     FEATURE_Mediabay_reset,
  32.     FEATURE_Mediabay_enable,
  33.     FEATURE_Mediabay_PCI_enable,
  34.     FEATURE_Mediabay_IDE_enable,
  35.     FEATURE_Mediabay_floppy_enable,
  36.     FEATURE_BMac_reset,
  37.     FEATURE_BMac_IO_enable,
  38.     FEATURE_Modem_Reset,
  39.     FEATURE_last,
  40. };
  41.  
  42. /* Note about the device parameter: Each device gives it's own entry. If NULL,
  43.    the feature function will just do nothing and return -EINVAL.
  44.    The feature management will walk up the device tree until in reaches a recognized
  45.    chip for which features can be changed and it will then apply the necessary
  46.    features to that chip. If it's not found, -ENODEV is returned.
  47.    Note also that feature_test/set/clear are interrupt-safe provided that they are
  48.    called _after_ feature_init() is completed.
  49.  */
  50.  
  51. /* Test whether a particular feature is enabled. May return -ENODEV*/
  52. extern int    feature_test(struct device_node* device, enum system_feature f);
  53.  
  54. /* Set a particular feature. Returns 0 or -ENODEV */
  55. extern int    feature_set(struct device_node* device, enum system_feature f);
  56.  
  57. /* Clear a particular feature */
  58. extern int    feature_clear(struct device_node* device, enum system_feature f);
  59.  
  60. /* Initialize feature stuff */
  61. extern void    feature_init(void);
  62.  
  63.  
  64. #endif /* __ASM_PPC_FEATURE_H */
  65.